package cn.twh.wall.boot;

import cn.twh.wall.service.BeetlHandle;
import cn.twh.wall.util.RandomUtil;
import cn.twh.wall.util.SnowFlake;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class BootStartListener implements ApplicationRunner {
    @Autowired
    private BeetlHandle beetlHandle;
    @Autowired
    private SnowFlake snowFlake;

    @Override
    public void run(ApplicationArguments args) {
        beetlHandle.init();
        snowFlake.init();

        beetlHandle.getGroupTemplate().registerFunctionPackage("wallUtil", RandomUtil.class);
    }
}
